static-lib=libmymath.a#库以lib开头，静态库以.a结尾，makefile 变量不能有空格 

$(static-lib):Add.o Div.o Mul.o Sub.o 
	ar -rc $@ $^ #打包命令

#Test:Add.o Div.o Mul.o Sub.o Testmain.o
#	gcc -o $@ $^

%.o:%.c #%通配符
	gcc -c $^ #自动生成同名.o 文件

.PHONY:output
output:
	mkdir -p mymath_lib/include
	mkdir -p mymath_lib/lib
	cp -f *.h mymath_lib/include
	cp -f *.a mymath_lib/lib
.PHONY:clean
clean:
	rm -rf *.o Test mymath_lib 
